<!DOCTYPE html>
<html>
<head>
    <title>派送修改</title>
    <meta charset=utf-8>
    <meta name=viewport content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" href="../../layui_2.5.5/css/layui.css">
    <script type="text/javascript" src="../../layui_2.5.5/layui.js"></script>

</head>
<body>
    <!--第二部分总体设置-->
    <form class="layui-form" action="hahahaha">
<hr class="layui-border-cyan">
  <div style="width: 100%;height: 40px;">
    <dd style="text-align-last: center;font-size:16px;">外包派送</dd>
</div>
<hr class="layui-border-cyan">

  <div class="layui-row" style="margin-top:10px">
    <div class="layui-col-xs3">
      <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                        <label class="layui-form-label">派送单号：</label>
                        <div class="layui-input-inline" style="width:160px;">
                            <input disabled="disabled" type="text" name="deliverynumber" id="deliverynumber" placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div></div>
    </div>
    <div class="layui-col-xs3">
      <div class="grid-demo"><div class="layui-inline">
                    <label class="layui-form-label">派送日期：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="deliveryDate" id="deliveryDate" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
                    </div>
                </div></div>
    </div>
    <div class="layui-col-xs3">
      <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                        <label class="layui-form-label">托运单号：</label>
                        <div class="layui-input-inline" style="width:160px;">
                            <input disabled="disabled" type="text" name="shippingnumber" id="shippingnumber" placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div></div>
    </div>
    <div class="layui-col-xs3">
      <div class="grid-demo"><div class="layui-inline">
                        <label class="layui-form-label">到达分站：</label>
                        <div class="layui-input-inline" style="width:160px;">
                            <select name="arrivesubstation" id="arrivesubstation"  lay-search="">
                                <option value=""></option>
                            </select>
                        </div>
                    </div></div>
    </div>
  </div>

  <div class="layui-row" style="margin-top:10px">
    <div class="layui-col-xs3">
      <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                        <label class="layui-form-label">司机姓名：</label>
                        <div class="layui-input-inline" style="width:160px;">
                            <input disabled="disabled" type="text" name="driverName" id="driverName" placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div></div>
    </div>
    <div class="layui-col-xs3">
      <div class="grid-demo"><div class="layui-inline">
                        <label class="layui-form-label">车辆牌号：</label>
                        <div class="layui-input-inline" style="width:160px;">
                            <input disabled="disabled" type="text" name="vehiclenumber" id="vehiclenumber" placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div></div>
    </div>
    <div class="layui-col-xs3">
      <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                        <label class="layui-form-label">手机号码：</label>
                        <div class="layui-input-inline" style="width:160px;">
                            <input disabled="disabled" type="text" name="phonenumber" id="phonenumber" placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div></div>
    </div>
    <div class="layui-col-xs3">
      <div class="grid-demo"><div class="layui-inline">
                        <label class="layui-form-label">派送费用：</label>
                        <div class="layui-input-inline" style="width:160px;">
                            <input type="text" name="deliveryfee" id="deliveryfee" placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div></div>
    </div>
  </div>

<div class="layui-row" style="margin-top:10px">
    <div class="layui-col-xs3">
      <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                        <label class="layui-form-label">操作员：</label>
                        <div class="layui-input-inline" style="width:160px;">
                            <input type="text" name="operator" id="operator" placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div></div>
    </div>
  </div>

  <div class="layui-row" style="margin-top:10px">
    <div class="layui-col-xs12">
      <div class="grid-demo">

            <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="formDemo" style="align-items: center">提交修改</button>
        </div>
    </div>
      </div>
    </div>
  </div>

    </form>
</body>
<script>
    layui.use(['form', 'layedit', 'laydate','table'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate
            ,table = layui.table;
            var $ = layui.jquery;

            //日期初始化
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#deliveryDate'
        });

        /*分站下拉框赋值*/
        $.ajax({
            url:"../../../getsubserieslist",
            success:function(data){
                for(var i =0;i<data.length;i++){
                    $("#arrivesubstation").append("<option value='"+data[i].subName+"'>"+data[i].subName+"</option>");
                    //重新渲染
                    form.render("select");
                }
            }
        });

        //监听提交：提交事件
        form.on('submit(formDemo)', function(data){
            $.ajax({
                type:'post'
                ,url:'../../updateOtherdelivery'
                ,data:data.field
                ,success:function(obj) {
                    if(obj.length>0){
                        parent.layer.close(1); //再执行关闭
                        //修改成功后刷新父界面
                        window.parent.location.reload();
                    }
                }
            });
            return false;
        });
    });
</script>
</html>